On Parsing LL-Languages
نویسنده
چکیده
Usually, a parser for an LL(k)-grammar G is a deterministic pushdown transducer which produces a leftmost derivation for a given input string x 2 L(G). Ukkonen 5] has given a family of LL(2)-grammars proving that every parser for these grammars has exponential size. If we add to a parser the possibility to manipulate a constant number of pointers which point to positions within the constructed part of the leftmost derivation and to change the output in such positions, we obtain an extended parser for the LL(k)-grammar G. Given an arbitrary LL(k)-grammar G, we will show how to construct an extended parser of polynomial size manipulating at most k 2 pointers.
منابع مشابه
Ch(k) Grammars: A Characterization of LL(k) Languages
From the point of view of parsing the LL(K] grammars constitute a very attractive class of context-free grammars. For each LL{K] grammar a top-down parsing algorithm can be devised which is essentially a one-state deterministic push-down automaton. From a more theoretiG point of view LL[K) grammars are attractive as well. It is well-known, for example, that it is decidable whether two LLfk) gra...
متن کاملGap Parsing with LL(1) Grammars
We study the time complexity of the parsing problem for input strings that contain gaps. For context-free languages the time requirement is cubic. For restricted classes of languages given by LL(1), bidirectional LL(1), and a specific kind of XML grammars, the time requirement is bounded linearly or quadratically depending on the number of separate gaps.
متن کاملExpressive Power of LL(k) Boolean Grammars
The paper studies the family of Boolean LL languages, generated by Boolean grammars and usable with the recursive descent parsing. It is demonstrated that over a one-letter alphabet, these languages are always regular, while Boolean LL subsets of Σ∗a∗ obey a certain periodicity property, which, in particular, makes the language {anb2n | n > 0} non-representable. It is also shown that linear con...
متن کاملLL ( 1 ) Conflict Resolution in a Recursive Descent Compiler Generator 1
Recursive descent parsing is restricted to languages whose grammars are LL(1), i.e., which can be parsed top-down with a single lookahead symbol. Unfortunately, many languages such as Java, C++, or C# are not LL(1). Therefore recursive descent parsing cannot be used or the parser has to make its decisions based on semantic information or a multi-symbol lookahead. In this paper we suggest a syst...
متن کاملLL(1) Conflict Resolution in a Recursive Descent Compiler Generator
Recursive descent parsing is restricted to languages whose grammars are LL(1), i.e., which can be parsed top-down with a single lookahead symbol. Unfortunately, many languages such as Java, C++, or C# are not LL(1). Therefore recursive descent parsing cannot be used or the parser has to make its decisions based on semantic information or a multi-symbol lookahead. In this paper we suggest a syst...
متن کاملFaster, Practical GLL Parsing
Generalized LL (GLL) parsing is an extension of recursivedescent (RD) parsing that supports all context-free grammars in cubic time and space. GLL parsers have the direct relationship with the grammar that RD parsers have, and therefore, compared to GLR, are easier to understand, debug, and extend. This makes GLL parsing attractive for parsing programming languages. In this paper we propose a m...
متن کامل